const {ipcRenderer,remote,ipcMain,dialog} = require('electron');
import renderModule from "./renderModule";


const path=require('path')
// const child = require("child_process");

renderModule.say()





ipcRenderer.on('change-mess',(e)=>{
    let messNode=document.getElementById('ma');
    messNode.innerText="After changing"
    console.log($('#ma').html());



    const child = require('child_process');

    let exe_sentence=path.join(path.dirname(__dirname),'/pages/js/al.sh')

    child.exec('bash '+exe_sentence, function(err, sto) {
        setTimeout(()=>{
            messNode.innerText = JSON.stringify(sto);
            console.log(sto);
        })//sto才是真正的输出，要不要打印到控制台，由你自己啊

    })


})


ipcRenderer.on('show-alert',(event,data) => {
    alert(JSON.stringify(data))
})
